<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>dash border</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="css/matrix-style.css" />
<link rel="stylesheet" href="css/matrix-media.css" />
<link rel="stylesheet" href="jquery-easyui/themes/default/easyui.css" />
<link rel="stylesheet" href="jquery-easyui/themes/icon.css" />
<script type="text/javascript" src="jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui/jquery.easyui.min.js"></script>
<style>
 .content-header{
/*   margin-top:-38px;
 */  font-size:16px;
  background-color:#fff;
 }
 .content-header table{
  font-weight:bolder;
  margin-left:30px;
 }
 .content-header .header-number{
  margin-left:10px;
 }
</style>
<script>
 $(document).ready(function(){
	 $.ajax({
			url:"<%=request.getContextPath()%>/task?method=taskcount",
			dataType:'json',
			type:'post',
			data:{},
			beforeSend:function(){
				
			},
			success:function(result){
				if(result.success){
					$("#count").text(result.count);
				}
			}
		})
	 $('#dg').datagrid({
			    title:'留学信息<a href="#" class="easyui-linkbutton" onclick="goto1()" style="float:right;">more</a>',
		        width:'100%',
		        height:'auto',
			    pagination:false,
			    rownumbers:false,
			    fitColumns:true,
			    singleSelect:true,
			    idField:'id',
			    url:'<%=request.getContextPath()%>/study?method=list10',
			    columns:[[
			        {field:'id',title:'编号',width:'20%',width:'30px',hidden:true
				
			        },
			        {field:'title',title:'标题',width:'80%',
			        	 styler:function(value,row,index){
						    	 return 'height:40px;'
					     },
					     formatter:function(value,row,index){
					    	 return '<a href="#" class="easyui-linkbutton" onclick="show('+row.id+')">'+row.title+'</a>';
					     }
			         },
			        {field:'content',title:'内容',hidden:true},
			        {field:'date',title:'发布时间',width:'25%' }
			    ]],
			 onClickRow: function (index, row) {//点击事件
		     }
			});
	      $('#dg2').datagrid({
			    title:'活动信息<a href="#" class="easyui-linkbutton" onclick="goto2()" style="float:right;">more</a>',
		        width:'100%',
			    pagination:false,
			    rownumbers:false,
			    fitColumns:true,
			    singleSelect:false,
			    idField:'id',
			    url:'<%=request.getContextPath()%>/travel?method=list10',
			    columns:[[
			        {field:'id',title:'编号',width:'20%',hidden:true},
			        {field:'title',title:'标题',width:'80%',
					 styler:function(value,row,index){
				    	 return 'height:40px;'
			         },
			         formatter:function(value,row,index){
				    	 return '<a href="#" class="easyui-linkbutton" onclick="show2('+row.id+')">'+row.title+'</a>';
				     }
				    },
			        {field:'content',title:'内容',hidden:true},
			        {field:'datetime',title:'发布时间',width:'25%'},
			    ]],
			 onClickRow: function (index, row) {//点击事件
		     }
			});
   	 $('#dg3').datagrid({
			    title:'近期新闻<a href="#" class="easyui-linkbutton" onclick="goto3()" style="float:right;">more</a>',
		        width:'100%',
			    pagination:false,
			    rownumbers:false,
			    fitColumns:true,
			    singleSelect:false,
			    idField:'id',
			    url:'<%=request.getContextPath()%>/news?method=list10',
			    columns:[[
			        {field:'id',title:'编号',width:'20%',hidden:true},
			        {field:'title',title:'标题',width:'80%',
					 styler:function(value,row,index){
				    	 return 'height:40px;'
			         },
			         formatter:function(value,row,index){
				    	 return '<a href="#" class="easyui-linkbutton" onclick="show3('+row.id+')">'+row.title+'</a>';
				     }
				    },
			        {field:'content',title:'内容',hidden:true},
			        {field:'datetime',title:'发布时间',width:'25%'},
			    ]],
			 onClickRow: function (index, row) {//点击事件
				
		     }
			});
	 //top menu
		var ddlMenu1 = $('#li1').menubutton({ menu: '#cusmenu1' }); 
		var ddlMenu2 = $('#li2').menubutton({ menu: '#cusmenu2' }); 

		//menubutton 依赖于 menu、linkbutton 这两个插件，所以我们可以这样搞定她
		$(ddlMenu1.menubutton('options').menu).menu({
		            onClick: function (item) {
		            	if(item.id=='id1'){
		            		
		            	}else if(item.id=='id2'){
		                    window.open("<%=request.getContextPath()%>/task?method=assisttasks","_blank")

		            	}else if(item.id=='id3'){
		                    window.open("<%=request.getContextPath()%>/","_self")

		            		
		            	}else if(item.id=='id4'){
		            		
		            	}
		            }
		});
		$(ddlMenu2.menubutton('options').menu).menu({
		            onClick: function (item) {
		            	 if(item.id=='id4'){
		            	}
		            }
		});
 })
</script>
<script>
function logout(){
	
		$.messager.confirm('Confirm','Are you sure you want to logout?',function(r){
            if (r){
                $.post('<%=request.getContextPath()%>/logout',function(result) {
					if (result.success) {
						$.messager.show({ // show error message
							title : '提示',
							msg : '退出成功'
						});
			           }
				 else {
						$.messager.show({ // show error message
									title : '提示',
									msg : '登录已过期，重新登录'
								});
					   }
				}, 'json');
    			window.open('<%=request.getContextPath()%>/index.jsp','_self');

		     }
	});
}
function profile(){
	window.open('<%=request.getContextPath()%>/profile?method=page','_self');
}
function gohome(){
	window.open('<%=request.getContextPath()%>/dashboard','_self');
}
function show(id){

	window.open('<%=request.getContextPath()%>/study?method=item&id='+id,'_blank');
}
function show2(id){
	window.open('<%=request.getContextPath()%>/travel?method=item&id='+id,'_blank');

}
function show3(id){
	window.open('<%=request.getContextPath()%>/news?method=item&id='+id,'_blank');

}
function goto1(){
 window.open('<%=request.getContextPath()%>/study?method=page','_self');	
}
function goto2(){
	 window.open('<%=request.getContextPath()%>/travel?method=page','_self');	
}
function goto3(){
	window.open('<%=request.getContextPath()%>/news?method=page','_self');	
}
function gotoMytask(){
	window.open('<%=request.getContextPath()%>/task','_self');
	
}
</script>
<script>

</script>
</head>
<body>

<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">Matrix Admin</a></h1>
</div>
<!--close-Header-part--> 
<!-- header menu -->
<ul style="position:absolute;left:200px;top:20px;list-style:none;">
 <li id="li2" style="float:left;padding:5px;color:#0094ff;font-size:12px;" icon="icon-lightning">首页</li>
</ul>

<!-- header menu -->
<div id="welcome" >
<h3 style="position:absolute;top:5px;right:30px;font-size:16px;height:35px;line-height:32px;background:white;border-radius:10px 10px">
<a href="#" onclick="gotoMytask()"><span style="padding:5px;border-radius:10px 10px ;color:white;background:red;" id="count"></span></a>
<a href="#" class="easyui-menubutton" data-options="menu:'#mm5',iconCls:'icon-man'" style="color:#0094ff;">${sessionScope.assist.id }</a>
</h3>
</div>
<div id="mm5" style="width:150px;">
		<div data-options="iconCls:'icon-undo'" onclick="profile()">个人设置</div>
		<div class="menu-sep"></div>
		<div>我的任务</div>
		<div class="menu-sep"></div>
		<div>系统消息</div>
		<div class="menu-sep"></div>
		<div onclick="logout()">安全退出</div>
</div>
	</div><!-- side bar start -->
<div id="sidebar" ><a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard2</a>
  <ul>
    <li class="active" ><a  href="<%=request.getContextPath()%>/dashboard"><i class="icon icon-home"></i> <span>Dashboard控制面板</span></a> </li>
    <li> <a href="<%=request.getContextPath()%>/study?method=page"><i class="icon icon-signal"></i> <span>Study news留学信息</span></a> </li>
    <li> <a href="<%=request.getContextPath()%>/travel?method=page"><i class="icon icon-inbox"></i> <span>Travel New活动信息</span></a> </li>
    <li><a href="<%=request.getContextPath()%>/news?method=page"><i class="icon icon-th"></i> <span>Recent News近期新闻</span></a></li>
    <li><a href="<%=request.getContextPath()%>/member?method=page"><i class="icon icon-fullscreen"></i> <span>Members centre会员中心</span></a></li>
    <c:choose>
     <c:when test="${sessionScope.assist.type eq 0}">
      <li><a href="<%=request.getContextPath() %>/assist"><i class="icon icon-th-list"></i> <span>助理管理</span></a></li>
     </c:when>
    </c:choose>
    <li><a href="<%=request.getContextPath() %>/task"><i class="icon icon-th-list"></i> <span>任务管理</span></a></li>
  </ul>
</div>
<div id="content">
  <div class="easyui-panel" style="padding:5px;" >
		<a href="#" class="easyui-linkbutton" style="position:relative;left:50px" data-options="plain:true">Follower:<span style="background:red;color:white;padding:5px;border-radius:10px;font-size:16px;">0</span></a>
		<a href="#" onclick="ordinary()" class="easyui-linkbutton" style="position:relative;left:200px;" data-options="plain:true">Probation members:<span style="background:red;color:white;padding:5px;border-radius:10px;font-size:16px;">0</span></a>
		<a href="#" onclick="vip()" class="easyui-linkbutton" style="position:relative;left:400px;" data-options="plain:true">Members:<span style="background:red;color:white;padding:5px;border-radius:10px;font-size:16px;">0</span></a>
		<a href="#" onclick="total()" class="easyui-linkbutton" style="position:relative;left:600px;" data-options="plain:true">total:<span style="background:red;color:white;padding:5px;border-radius:10px;font-size:16px;">0</span></a>
  </div>

 <div style="margin-top:20px;">
 <div style="float:left;display:block;width:30%;margin:0px 2%">  <table id="dg" ></table></div>
 <div  style="float:left;display:block;width:30%;margin:0px 1%">  <table id="dg2"></table></div>
 <div style="float:left;display:block;width:30%;margin:0px 2%"><table id="dg3" ></table></div>
 </div>
</div>
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2016 &copy; <a href="http://themedesigner.in/">guangzhoushuntian information technology</a> </div>
</div>
<!--end-Footer-part-->

</body>
</html>
